<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui"
	template="/layout/dialogLayout.xhtml">

	<ui:param name="param_panelTitle" value="更新订单状态" />
	<ui:param name="param_panelWidth" value="540px" />

	<ui:define name="content">
	   <script type="text/javascript">
	    function reRender(){
	    	try{
	    		    UI.instance.reRender('reRenderOrderTable');
	    	}catch(err){
	    			UI.instance.resetContent("/luyuan/sale/orderListForChecker.jsf")
	    	}
	    		    UI.instance.closeDialog();
	    }
	   </script>
		<a:form id="orderForm">
			<rg:titlePanel needButton="true" type="writable">
				<ui:define name="panelBody">
					<rg:fieldSet column="single">
					<rg:selectOne id="shipMethodType"
                            value="#{orderCheckerAction.order.delivery.expressCompany}" label="快递方式"
                            itemsProvider="#{expressCompanyProvider}" converter="#{expressCompanyConverter}"/>
					<rg:selectOne id="shipPayType"
                            value="#{orderCheckerAction.order.delivery.settlementType}" label="快递付款方式"
                            itemsProvider="#{settlementTypeProvider}" converter="#{settlementTypeConverter}" />
                    <rg:field id="address" label="收货地址">
                    	<h:selectOneMenu id="province" value="#{orderCheckerAction.order.delivery.deliveryAddress.province}" 
                    		styleClass="select"  style="margin-right:10px"
                    		onchange="jQuery('#orderForm\\:city').val(null);jQuery('#orderForm\\:region').val(null);">
                   			<f:selectItem itemLabel="请选择省"/>
                    		<f:selectItems value="#{provinceProvider.getSelectItems(null)}" />
                    	</h:selectOneMenu>
                    	<h:selectOneMenu id="city" value="#{orderCheckerAction.order.delivery.deliveryAddress.city}" 
                    		styleClass="select"  style="margin-right:10px"
                    		onchange="jQuery('#orderForm\\:region').val(null);">
                   			<f:selectItem itemLabel="请选择市"/>
                    		<f:selectItems value="#{cityProvider.getSelectItems(orderCheckerAction.order.delivery.deliveryAddress.province)}" />
                   			<rg:reference for="province"  eventsQueue="address"/>
                    	</h:selectOneMenu>
                    	<h:selectOneMenu id="region" value="#{orderCheckerAction.order.delivery.deliveryAddress.region}" 
                    		styleClass="select"  style="margin-right:10px">
                   			<f:selectItem itemLabel="请选择区（县）"/>
                    		<f:selectItems value="#{regionProvider.getSelectItems(orderCheckerAction.order.delivery.deliveryAddress.province,orderCheckerAction.order.delivery.deliveryAddress.city)}" />
                   			<rg:reference for="province,city"  eventsQueue="address"/>
                    	</h:selectOneMenu>
                    	<h:inputText id="street" value="#{orderCheckerAction.order.delivery.deliveryAddress.street}"   styleClass="text" style="width:256px;"/>
                    </rg:field>
					<rg:inputText id="postCode" label="#{messages.luyuan_member_postCode}" value="#{orderCheckerAction.order.delivery.deliveryAddress.postCode}" >
						<rg:reference for="city,region" actionListener="#{orderCheckerAction.resetPostCode}" eventsQueue="address"/>
					</rg:inputText>
					<rg:inputArea label="回访记录"
							value="#{orderCheckerAction.remarks}" id="remarks"
							cols="100" />
					</rg:fieldSet>
				</ui:define>
				<ui:define name="panelButton">
					<a:commandButton styleClass="button" value="审核通过"
						oncomplete="reRender();"
						actionListener="#{orderCheckerAction.verifyOrder('verify')}" />

					<a:commandButton styleClass="button" value="取消订单"
						oncomplete="reRender();"
						actionListener="#{orderCheckerAction.verifyOrder('cancel')}" />

					<button class="button" onclick="UI.instance.closeDialog()" >关闭</button>
				</ui:define>
			</rg:titlePanel>
		</a:form>
	</ui:define>
</ui:composition>
